/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "stdafx.h"
#include "动画点.h"


static std::map< C_记录点节点*, std::vector< std::vector<S_Rect2Df> >> g_点记录;


static void f_Operator执行关键帧烘焙(S_结构对象指针 ops) {
	C_记录点节点* node = (C_记录点节点*)ops;
	//node->m_执行状态 = DEF_执行状态_准备;
	if (node->m_开启记录 == false) {
		node->m_开启记录 = true;

		g_点记录[node].clear();

	} else {
		node->m_开启记录 = false;


	}
}





C_记录点节点::C_记录点节点(S_设备环境& ctx) : C_节点基类("记录点节点") {
	C_插座基类* socket;
	DEF_创建物体插座_I(L"物体");
	DEF_Rect32f_Array1D_插座创建_I(L"跟踪坐标")

	//DEF_创建物体插座_I("物体");
	m_开启记录 = false;
	m_执行Ops = f_alloc_Ops(f_Operator执行关键帧烘焙, (S_结构对象指针)this);
	//m_开启点烘焙 = f_alloc_OpsProp(m_执行Ops, L"记录点关键帧");

}

C_记录点节点::~C_记录点节点() {
	f_free_Ops(m_执行Ops);
}

bool C_记录点节点::f_update() {
	auto& out区域 = *DEF_Rect32f_Array1DValue(f_get输入插座(2), 0);

	if (m_开启记录) {
		//uint32 num = out区域.size();
		g_点记录[this].push_back(out区域);

		std::cout<<"烘焙顶点坐标"<<std::endl;
	}

	return false;
}








C_节点基类* f_node_加载记录点节点(S_设备环境& ctx, FILE* f) {
	C_记录点节点* node = new C_记录点节点(ctx);

	return node;
}





